package com.yun.zf.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yun.zf.common.admin.dto.sys.SubWayDto;
import com.yun.zf.common.admin.model.sys.SubWay;
import com.yun.zf.common.app.domain.ZfSubway;
import com.yun.zf.system.mapper.ZfSubwayMapper;
import com.yun.zf.system.service.ZfSubwayService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 地铁线路表 服务实现类
 * </p>
 *
 * @author cj
 * @since 2021-01-29
 */
@Service
public class ZfSubwayServiceImpl extends ServiceImpl<ZfSubwayMapper, ZfSubway> implements ZfSubwayService {

    /**
     * 根据城市代码查询地铁线路
     * @param cityCode
     * @return
     */
    @Override
    public List<SubWayDto> subwaysByCity(Long cityCode) {
        return  baseMapper.getSubs(cityCode);
    }

    @Override
    public Long  addSubWay(ZfSubway subWays) {
        baseMapper.insert(subWays);
        return subWays.getId();
    }
}
